package com.blockmeta.bbs.immodule.widget.msgview;

import android.content.Context;
import android.widget.TextView;

import com.blockmeta.bbs.immodule.R;
import com.blockmeta.bbs.immodule.bean.IMCommonLib;
import com.blockmeta.bbs.immodule.bean.Params;
import com.blockmeta.bbs.immodule.corebean.Impl.IMApplicationContext;
import com.blockmeta.bbs.immodule.dao.ChatMessage;
import com.blockmeta.bbs.immodule.dao.IMUserEntity;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class SysMsgView<T extends ChatMessage> extends MsgView<T>{


    public SysMsgView(Context context) {
        super(context);
    }

    @Override
    public int getLayoutId() {
        return R.layout.im_chat_notify;
    }

    @Override
    public void convert(final BaseViewHolder helper, final T item, T lastItem) {
        super.convert(helper, item, lastItem);

        long chatGroupId = item.getMsgType() == ChatMessage.MSG_TYPE_UCG ? item.getChatGroupId() : 0;
        String content = item.getContent();
        content = IMApplicationContext.getCircleDomainService().getTagConvert(content, chatGroupId);

        TextView textView = helper.getView(R.id.tv_notify);
        IMCommonLib.fillContent(textView, content, mContext);
    }
}
